use_frameworks!

platform :ios, '10.0'
source 'https://gitee.com/zj1208/specs.git'
source 'https://gitee.com/mirrors/CocoaPods-Specs.git'
target 'ZXTimer_Example' do
  
  pod 'ZXTimer', :path => '../'
  pod 'MLeaksFinder'
  pod 'ZXUIImageUtils'

  target 'ZXTimer_Tests' do
    inherit! :search_paths

    pod 'FBSnapshotTestCase'
  end
end



post_install do|installer|
   #解决问题一
   find_and_replace("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm",
       "layoutCache[currentClass] = ivars;", "layoutCache[(id)currentClass] = ivars;")
   #解决问题二
   find_and_replace("Pods/FBRetainCycleDetector/fishhook/fishhook.c",
   "indirect_symbol_bindings[i] = cur->rebindings[j].replacement;", "if (i < (sizeof(indirect_symbol_bindings) /
        sizeof(indirect_symbol_bindings[0]))) { \n indirect_symbol_bindings[i]=cur->rebindings[j].replacement; \n }")
end
def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
    FileUtils.chmod("+w",name) #add
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)
      if text != replace
         puts "Fix: " + name
         File.open(name, "w") { |file| file.puts replace }
         STDOUT.flush
      end
  end
  Dir[dir + '*/'].each(&method(:find_and_replace))
end
